/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-03-31
 * Time: 19:10
 */
class MyThread extends Thread{
    @Override
    public void run() {
          System.out.println("hello ");
    }
}
class MyRunnable implements Runnable{
    @Override
    public void run() {
        System.out.println("hello ");
    }
}
public class Demo1 {
    public static void main(String[] args) {
        Thread thread=new MyThread();
        thread.start();
        Thread thread2=new Thread(new MyRunnable());
        thread2.start();
        Thread thread3=new Thread(){
            @Override
            public void run() {
                System.out.println("hello");
            }
        };
        thread3.start();
        Thread thread4=new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello ");
            }
        });
        thread4.start();
        Thread thread5=new Thread(()->{
            System.out.println("hello ");
        });
        thread5.start();
    }
}
